<?php $theme->display ( 'header' ); ?>
<!-- tumble -->
<div id="post-1" class="post published">
    <div class="meta">
        <h2><a href="<?php echo Controller::get_full_url() ?>" title="Tumble Archives">Tumbel Archives</a></h2>
	</div>
	<div class="entry">
			<?php 
				if( !empty( $theme->tumblearchive ) ) {
					foreach( $theme->tumblearchive as $y=>$year ) {
						
						printf( "<h3><a href=\"%s\">" . _t( 'Year: %d(%d)' ) . "</a></h3>\n", $year[ "url" ], $y, $year[ "count" ] );
						
						foreach( $year["months"] as $m=>$month ) {
							printf( '<span class="exp"><a href="%s">' . _t( '%s (%d)' ) . '</a></span><ul class="tumble-archive">', $month[ "url" ], 
							date( "F", mktime(0, 0, 0, $m, 1, 2000 ) ), $month[ "count" ] );
							
							foreach( $month["days"] as $d=>$day ) {
								//printf( _t( '      Day: %d(%d)<br>' ), $d, $day[ "count" ] );
								foreach( $day["posts"] as $p=>$post ) {
									if($post instanceOf Post) {
										printf( "<li>" . _t( '<a href="%s"><span>%s: %s</span><span class="hover">Jan 23rd</span></a>' ) . "</li>\n", $post->permalink, $post->title, $post->entry);
									}
								}
							}
							echo "</ul>";
						}
					}
				}
			?>
	</div>
</div>
<!-- /tumble -->
<?php $theme->display ( 'footer' ); ?>